
var num = 0;
var divObj;
function mouseOver(e) {
	e.style.background = "#0080ff";
}
function mouseOut(e) {
	e.style.background = "#ff8000";
}
function mouseClick(errorDivId) {
        //document.getElementById("key").value=e.innerText;
	document.getElementById(errorDivId).style.display = "none";
}
function getOjbPosition(htmlId) {
	var arr = new Array();
	var obj = document.getElementById(htmlId);
	var x = obj.offsetLeft;
	var y = obj.offsetTop + obj.offsetHeight;
	while (obj.offsetParent) {
		obj = obj.offsetParent;
		x += obj.offsetLeft;
		y += obj.offsetTop;
	}
	arr[0] = x;
	arr[1] = y;
	return arr;
}
function showMenu(checkId, errorDivId) {
	var arr = getOjbPosition(checkId);
	var left = arr[0];
	var top = arr[1];
        //var left=0;
        //var top=0;
	var obj = document.getElementById(checkId);
	var div = document.getElementById(errorDivId);
	div.style.position = "absolute";
        //div.style.position="relative";
	div.style.background = "FF8000";
	div.style.zIndex = 2000;
	div.style.left = left;
	div.style.top = top;
	div.style.width = obj.offsetWidth;
	var width = div.style.width;
	width = width.substring(0,width.length-2);
	if(width<100)
	{
		div.style.width=150;
	}
	div.style.display = "";
	divObj = div;
}
function showMenuDelegate(checkId, errorDivId, errorImgId, errorMsg) {
	var messge = "<iframe src=\"javascript:false\" style=\"position:absolute; " + "visibility:inherit; top:0px; left:0px; width:100px; height:30px; z-index:-1;" + " filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';\"></iframe>";
	document.getElementById(errorDivId).innerHTML = messge + errorMsg;
	showMenu(checkId, errorDivId);
	document.getElementById(errorImgId).style.display = "inline";
	document.getElementById(errorImgId).src = "../images/error.gif";
}
	//用于登录验证
function showMenuDelegate_01(checkId, errorDivId, errorImgId, errorMsg, srcUrl) {
	var messge = "<iframe src=\"javascript:false\" style=\"position:absolute; " + "visibility:inherit; top:0px; left:0px; width:100px; height:30px; z-index:-1;" + " filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';\"></iframe>";
	document.getElementById(errorDivId).innerHTML = messge + errorMsg;
	showMenu(checkId, errorDivId);
	document.getElementById(errorImgId).style.display = "inline";
	document.getElementById(errorImgId).src = srcUrl + "images/error.gif";
}
// 公共验证方法,验证某值是否为空
function checkNullValue(checkValue) {
	var nullPattern = /^\s+|\s+$/g;
	if (checkValue.replace(nullPattern, "") == "") {
		return true;
	} else {
		return false;
	}
 }
// 隐藏红X图片	
function hiddenErrorImg(errorImgId) {
	document.getElementById(errorImgId).style.display = "none";
}	
//改变文本框的边框线	
function changeTextfiledBorderColor(changeId) {
	var ele = document.getElementById(changeId);
	ele.style.borderColor = "cccccc";
}	
//显示错误提示信息	 
function funShowErrorDiv(errorDivId){
	document.getElementById(errorDivId).style.display='';
}
//验证特殊字符
function isSpecial(str)
{
	var wordPattern = /\'+|\%+/;
	return wordPattern.test(str);
}